/*	TGErrorManager.m
 *	Part of ThinkGeek LED Clock
 *	http://tmorgan.shutupgeorge.com/thinkgeek/
 *
 * Copyright (c)2003-2006 Tim Morgan. All rights reserved. Please visit
 * http://tmorgan.shutupgeorge.com/other/license.html for more information about
 * your rights and responsibilities regarding this source code.
 */

#import <Cocoa/Cocoa.h>

/** A list of numerical error code constants. */
typedef enum _TGError {
	TGErrorInvalidBackgroundStyle = -100,
	TGErrorInvalidClockTheme = -101
} TGError;

/** The error domain for this program's errors. */
const NSString *TGErrorDomain;

/**
 * Manages, creates, and interprets errors in the program. All errors exist as
 * codes specified by {@link TGError} and are represented by
 * <code>NSError</code> objects within the domain {@link TGErrorDomain}.
 *
 * @author Tim Morgan
 */

@interface TGErrorManager : NSObject {

}

/**
 * Returns the singleton instance of this class, instantiated by the nib file.
 *
 * @return The singleton instance of this class
 */

+ (TGErrorManager *) errorManager;

/**
 * Returns an error according to {@link #errorOfType::} with no user info.
 *
 * @param errorType the error code
 * @return The error object
 */

- (NSError *) errorOfType:(TGError)errorType;

/**
 * Returns an error object for the given error code. The error will be in the
 * {@link TGErrorDomain} domain.
 *
 * @param errorType the error code
 * @param userInfo any additional data associated with the error, to be stored
 *                 in the <code>NSError</code> object
 * @return The error object
 */

- (NSError *) errorOfType:(TGError)errorType userInfo:(NSDictionary *)userInfo;

@end
